INSERT INTO cat_material
SELECT top 200
newid() AS [Id],'' AS [Name],1 AS [AdMode],2 AS [AdType],Title AS [Text],'' AS [TextStyle],Link AS [NavigateUrl],1 AS [Target],NULL AS [ImageUrl],NULL AS [ImageBinary],NULL AS [MimeType],NULL AS [Width],NULL AS [Height],NULL AS [AlternateText],NULL AS [FlashUrl],NULL AS [IsTransparency],NULL AS [FlashBinary],NULL AS [Notes],case len(convert(varchar(10),companyid))
    when 5 then '00000000-0000-0000-0000-0000000' + convert(varchar(10),companyid) 
    when 4 then '00000000-0000-0000-0000-00000000' + convert(varchar(10),companyid) 
    when 3 then '00000000-0000-0000-0000-000000000' + convert(varchar(10),companyid) 
    when 2 then '00000000-0000-0000-0000-0000000000' + convert(varchar(10),companyid) 
    when 1 then '00000000-0000-0000-0000-00000000000'+ convert(varchar(10),companyid) 
    end  As [CompanyId],GetDate() AS [DateCreated],GetDate() AS [LastUpdated]FROM srv_lnk.nchr2008.dbo.FamousJob
Where expireddate >= '2012-7-1'
